﻿namespace DCHealthCheck.MvcWeb.Classes.ViewModels {

    #region Usings
    using DCHealthCheck.Common;
    using DCHealthCheck.DomainModel;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading;
    using System.Web;
    using System.Web.Mvc;
    #endregion

    public class ReplicationNeighborViewModel : BaseViewModel {

        #region Members
        public string PartitionName { get; set; }
        public List<ReplicationNeighbor> ReplicationNeighbors { get; set; }
        public string ReplicationReason { get; set; }
        public string SourceServer { get; set; }

        #region Control SelectListItem collections
        public List<SelectListItem> PartitionNameSelectListItems { get; private set; }
        public List<SelectListItem> ReplicationReasonSelectListItems { get; private set; }
        public List<SelectListItem> SourceServerSelectListItems { get; private set; }
        #endregion
        #endregion

        #region Constructor
        public ReplicationNeighborViewModel() {

            this.ReplicationNeighbors = new List<ReplicationNeighbor>();
            this.SourceServerSelectListItems = new List<SelectListItem>();
            this.PartitionNameSelectListItems = new List<SelectListItem>();
            this.ReplicationReasonSelectListItems = new List<SelectListItem>();
        } 
        #endregion

        #region Methods
        public override void Initialize(){
            Global.DefaultLog.DebugFormat("[ThreadId: {0}] {1}", Thread.CurrentThread.ManagedThreadId, Extensions.CurrentMethodName());

            base.Initialize();
            this.TakeCount = 15;

            if (string.IsNullOrWhiteSpace(this.SortColumn)) {
                this.SortColumn = "SystemInfo.DomainController.SamAccountName";
            }
        } 
        #endregion

    }
}